
<template>
<!-- 控制操作按钮 提示：无此权限 提示：合作机构号失效，请联系您的代理商 -->
        <a-button :type="buttonType" block @click="judgeHandle()" :disabled="disabled">
            {{buttonText}}
        </a-button>
    
</template>

<script>
import api from "@/common/api";
export default {
    props: {
        buttonType: {
            type: String,
            default: 'link'
        },
        buttonText: {
            type: String,
            default: '详情'
        },
        toolParams:{
            type: String,
            default: ''
        },
        disabled: {
            type: Boolean,
            default: false
        }

    },

    data () {
        return {
            IsPermission:false  // 有无权限
        }
    },

    methods: {
        judgeHandle () {
            api.checkPermission({code:this.toolParams},res=>{
               if( res.code === "OK") {
                     this.$emit("click")
               }else{
                 this.$message.warning(res.message)
               }
            })
        }

    }
}
</script>